<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
    <script type="text/javascript">
        function submitBtnClick(){
            document.fileForm.submit();
        }

    </script>
    
</head>

<body>

<?php
    echo '<script>alert("欢迎登录！管理员")</script>';
     $conn=@mysql_connect("localhost","root","")  or die(mysql_error());
     mysql_query("SET NAMES UTF8");
     @mysql_select_db('guyueyan',$conn) or die(mysql_error());
    
    //查询登录用户上传的图片  
    $sqlstr = "select * from picture";
    $query = mysql_query($sqlstr) or die(mysql_error());
    
    $count = 0;  //控制单元格数
?>
<form action="manage_up.php" method="post">
    <table width='80%' border='1' cellspacing='3' cellpadding='2'>
    <tbody>
  
    <?php
    while($thread=mysql_fetch_row($query)){
        
        $id = $thread[0];   //图片的id
        $houzui = explode("/",$thread[3])[1];
        if($count%3==0)
            echo "<tr>";
        
        echo "<td style='width: 32%;height: 620px;text-align: center'>";
        
         echo "<img src='photo_xianshi.php?id=$id.$houzui' width='100%' alt='' referrerpolicy='no-referrer'/><br>";
        
        
        echo "<input name='ids[]' type='hidden' value=$id>";//隐藏域,传送图片的id
        
        echo "<div><input name='urls[]' type='text'><div><br>";
        echo "<div><input name='ann$count' type='submit' id='ann' value='上传'>";    
       echo "<input style='margin-left: 25px;' name='shan$count' type='submit' id='ann' value='删除'></div>";
        $count++;
        
        echo "</td>";
         if($count%3==0)
            echo "</tr>";
    }
       
    ?>
     </tbody>  
    </table>

</form>
</body>
</html>